﻿using LpbPrj.Client.Event;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;

namespace LpbPrj.Client.ViewModels
{
    public class NonClientAreaContentViewModel : GlobalBaseViewModel
    {
        public NonClientAreaContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IDialogService dialogService)
            : base(eventAggregator, regionManager, dialogService)
        {
            CopyRight = VersionHelper.GetCopyright();
            Version = VersionHelper.GetVersion();
        }

        public DelegateCommand<string> ProjectCmd =>
            new Lazy<DelegateCommand<string>>(() => new DelegateCommand<string>(p =>
            {
                if (string.IsNullOrEmpty(p)) return;
                _eventAggregator.GetEvent<MessageSentEvent>().Publish(new MessageEvent(EventKey.NonClientAreaContentOpt, p));

            })).Value;

        public string CopyRight { get => _copyRight; set => SetProperty(ref _copyRight, value); }
        private string _copyRight = string.Empty;

        public string Version { get => _version; set => SetProperty(ref _version, value); }
        private string _version = string.Empty;

    }

}
